home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / mmdf-IIb.43 / h / dm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1986-10-09  |  2.9 KB  |  69 lines

  1. /*  Domain-Table definitions
  2.  *
  3.  *  A Domain table contains entries that reference specific host names
  4.  *  (i.e., symbolic/routing addresses).  A table may either be used
  5.  *  strictly as a domain table, in which case the format is:
  6.  *
  7.  *      domain-name  host-name [ domain-name, ... ]
  8.  *
  9.  *  so that 'a.b.c' will look up 'a' in 'b.c' and find it on the
  10.  *  left-hand side.  The right-hand part of the entry is then used
  11.  *  as a host name and is looked up in the routing tables.  If the
  12.  *  right-hand part has more than one field, then the first part is
  13.  *  taken as the 'next' host to send to and the remaining parts are
  14.  *  taken as routing references, by domain name.  The order is
  15.  *  sequentially forward, so that the second field references the
  16.  *  host that is to receive the message, after the one we hand it to.
  17.  *  (This is the same as the way that SMTP orders its routing info.)
  18.  *
  19.  *  Alternately, a table may be a standard host table, in which case, its
  20.  *  format is:
  21.  *
  22.  *      host-name address-value
  23.  *
  24.  *  such as 'udel-relay 10.0.0.96'.  That is, the table was originally
  25.  *  built as a name-to-net-address table, but is doubling as a domain
  26.  *  table.  In this case, the 'final' sub-domain name is the same as the
  27.  *  host name, such as 'udel-relay.arpa' mapping to 'udel-relay'.
  28.  *
  29.  *  A table fully specifies its location within the domain hierarchy, so
  30.  *  that a site may have a 'udel.arpa' table, containing the name of
  31.  *  sites at udel, and also have an 'arpa' table, containing the names
  32.  *  of other domains/sites within the arpa domain.  In the list of
  33.  *  domain tables, 'udel.arpa' comes first, so that it intercepts
  34.  *  references to the 'udel' sub-domain.
  35.  *
  36.  *  Note that this domain usage involves 'flat' tables, in that you
  37.  *  only do one domain lookup, at this site, to acquire the symbolic
  38.  *  host address.  This lacks some generality, but should provide some
  39.  *  efficiency.  The design is predicated on the expectation that a
  40.  *  site will not have many domain tables (which are subordinate to
  41.  *  other tables at that site).
  42.  */
  43.  
  44. struct dm_struct
  45. {
  46.     char    *dm_name;           /* internal name of domain              */
  47.     char    *dm_domain;         /* full name of containing domain       */
  48.     char    *dm_show;           /* pretty-print version of name         */
  49.     Table   *dm_table;          /* table containing entries for domain   */
  50. };
  51.  
  52. typedef struct dm_struct    Domain;
  53. typedef struct dm_struct    Dmn;
  54. /*HACK*/
  55. #define dm_tell(thetable) (((Table *)thetable) -> dm_tpos)
  56.  
  57. Domain *dm_nm2struct ();
  58.  
  59. #define DM_NFIELD  16           /* maximum number of routing fields     */
  60.  
  61. struct dm_rtstruct
  62. {
  63.     int     dm_argc;            /* number of domain value fields        */
  64.     char   *dm_argv[DM_NFIELD]; /* pointers to each field               */
  65.     char    dm_buf[LINESIZE];   /* where to stash domain value string   */
  66. };
  67.  
  68. typedef struct dm_rtstruct    Dmn_route;
  69.